#pragma once

#include<iostream>
#include<memory>
#include<unordered_map>
using namespace std;

using namespace std;

//先描述
//保存用户信息
class Session{
private:
    int session_id;
    string session_name;
    string passwd;
    string session_date;
    string session_time;
public:
    Session(int id, string name, string date, string time){
        session_id = id;
        session_name = name;
        session_date = date;
        session_time = time;
    }
    void display(){
        cout<<"Session ID: "<<session_id<<endl;
        cout<<"Session Name: "<<session_name<<endl;
        cout<<"Session Date: "<<session_date<<endl;
        cout<<"Session Time: "<<session_time<<endl;
    }
};

//在组织
using seeion_ptr=unique_ptr<Session>;

class SessionManager
{
    public:
    SessionManager(){}
    ~SessionManager(){}
    string AddSession(int id, string name, string date, string time)
    {
        auto session = make_unique<Session>(id, name, date, time);
        sessions[id] = move(session);
        //返回的是唯一标识用户的session_id
        return to_string(id);
    }
    private:
        unordered_map<int, seeion_ptr> sessions;
};